package com.xinke.juc.case03;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.locks.LockSupport;

/**
 * @Author：xinke
 * @Date：2025/9/30
 * @Desc: 打断 park 线程, 不会清空打断状态
 */
@Slf4j
public class TestInterrupt05 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            log.debug("park...");
            LockSupport.park();
            log.debug("unpark...");
            log.debug("打断状态：{}", Thread.currentThread().isInterrupted());
        }, "t1");
        t1.start();
        Thread.sleep(500);
        t1.interrupt();
    }
}
